// export function handleTime(){
// 	var date = new Date()
// 	var time = {week:'',dates:''}
// 	var month = date.getMonth()+1
// 	var day = date.getDate()
// 	var w = date.getDay()
// 	console.log(w,'dd')
// 	var recently = []
// 	// time.dates = month+'-'+day
// 	switch(w){
// 		case 0:
// 			time.week ='周日'
// 			break
// 		case 1:
// 			time.week ='周一'
// 			break
// 		case 2:
// 			time.week ='周二'
// 			break
// 		case 3:
// 			time.week ='周三'
// 			break
// 		case 4:
// 			time.week ='周四'
// 			break
// 		case 5:
// 			time.week ='周五'
// 			break
// 		case 6:
// 			time.week ='周六'
// 			break
// 	}
	
// 	for(let i=0;i<7;i++){
// 		day += 1
// 		time.dates = month+'-'+day
// 		console.log(day)
// 		recently.push(time)
// 	}
// 	return recently
// 	// console.log(time)
// }

// export default hanldeTime
// let time = {week:'',dt:''}
function getWeek(w){
	switch(w){
				case 0:
					return '周日'
					break
				case 1:
					return '周一'
					break
				case 2:
					return '周二'
					break
				case 3:
					return '周三'
					break
				case 4:
					return '周四'
					break
				case 5:
					return '周五'
					break
				case 6:
					return '周六'
					break
		}
}

export function handleTime() {
  let dates = [];
  for (let i = 0; i < 7; i++) {
    let date = new Date();
	let time = {week:'',dt:''}
    date.setDate(date.getDate() + i);
	// console.log(getWeek(date.getDay()))
	time.week = getWeek(date.getDay())
	time.dt =date.toISOString().split('T')[0]
    dates.push(time);
  }
  return dates;
}
 
// 使用示例
// let lastWeekDates = handleTime();
// console.log(lastWeekDates); // 打印最近一周的日期数组，格式为YYYY-MM-DD